<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head th:fragment="head">
  <title>SpringMVC留言板</title>
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
  <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<nav class="navbar navbar-default" th:fragment="topbar">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" th:href="@{/}">SpringMVC</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a th:href="@{/}">首页 <span class="sr-only">(current)</span></a></li>
        <li><a th:href="@{/message/index}">留言</a></li>
      </ul>
      <form class="navbar-form navbar-left" method="get" th:action="@{/message/index}">
        <div class="form-group">
          <input type="text" name="keyword" th:value="${#request.getParameter('keyword')}" class="form-control" placeholder="Search">
        </div>
        <button type="submit" class="btn btn-default">Search</button>
      </form>
      <ul class="nav navbar-nav navbar-right">
        <li shiro:notAuthenticated><a th:href="@{/public/register}">注册</a></li>
        <li shiro:notAuthenticated><a th:href="@{/public/login}">登录</a></li>
        <li shiro:Authenticated><a th:href="@{/member/index}">我的</a></li>
      </ul>
    </div>
  </div>
</nav>
<div class="row" th:fragment="memberTop">
  <div class="col-xs-6 col-md-2">
    <a th:href="@{/member/index}">
        <img th:if="${user.avatar != null}" style="width:118px;height:118px;" th:src="${user.avatar}" class="img-circle" alt="...">
        <img th:unless="${user.avatar}" src="//t.cn/RCzsdCq" class="img-circle" alt="...">
    </a>
  </div>
  <div class="col-md-10 col-xs-6">
    <div class="page-header">
      <h1>[[${user.name}]] <small>欢迎你</small></h1>
    </div>
  </div>
</div>
</html>
<ul class="list-group" th:fragment="memberLeft">
  <li class="list-group-item">
    <a th:href="@{/message/send}">发布新的留言</a>
  </li>
  <li class="list-group-item">
    <a th:href="@{/member/profile}">个人资料</a>
  </li>
  <li class="list-group-item">
    <a th:href="@{/member/updatePass}">修改密码</a>
  </li>
  <li class="list-group-item">
    <a th:href="@{/public/logout}">退出登录</a>
  </li>
</ul>